package com.oa.utils;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

public class PageBean {

    private int currentPage;            //当前页码书
    private int pageSize;                //总数
    private DetachedCriteria criteria;    //查询条件
    private List data;                    //当前页需要展示的数据集合
    private int count;                    //总记录数
    private String msg = "";
    private int code = 0;

    // 计算起始索引
    public int getStart() {
        return (this.currentPage - 1) * this.pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public DetachedCriteria getCriteria() {
        return criteria;
    }

    public void setCriteria(DetachedCriteria criteria) {
        this.criteria = criteria;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


}
